
function BlogCtrl($scope,  $routeParams) {

  $scope.idPost =  $routeParams.id

  $scope.showRecentPostsPanel = false;
  $scope.isCollapsed = false;

 /* if ($scope.idPost == undefined) {
    $scope.showRecentPostsPanel = true;
    $scope.isCollapsed = false;
  }*/

/*  $scope.tinymce = "oiè<b>sfsa</b>"*/
}




function DemoFileUploadController($scope, $http) {

    var url = 'lib/jquery-upload/server/php/';

    $scope.loadingFiles = true;
    $scope.options = {
        url: url
    };
    $http.get(url)
        .then(
            function (response) {

                $scope.loadingFiles = false;
                $scope.queue = response.data.files;

               
                  console.log ("demo fsile", $scope.queue)
            },
            function () {
                $scope.loadingFiles = false;
            }
        );
              

    $scope.$watch("queue", function(newVal) {
	   	if ($scope.queue.length > 0)
	    	$scope.isAttachFilePanellHidden = false
	    else
	    	$scope.isAttachFilePanellHidden = true
	}, false); 

    
}





function FileDestroyController($scope, $http) {


		var file = $scope.file, state;


		if (file.url) {
		    file.$state = function () {
		        return state;
		    };
		    file.$destroy = function () {
		        state = 'pending';
		        return $http({
		            url: file.delete_url,
		            method: file.delete_type
		        }).then(
		            function () {
		                state = 'resolved';
		                $scope.clear(file);
		            },
		            function () {
		                state = 'rejected';
		            }
		        );
		    };
		}

}
